package com.smartcampusbackend.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.smartcampusbackend.model.LeaveApplication;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.time.LocalDateTime;
import java.util.List;

@Mapper
public interface LeaveApplicationMapper extends BaseMapper<LeaveApplication> {
    @Select("SELECT * FROM leave_application WHERE status = 'PENDING' AND create_time <= #{threeMinutesAgo} ORDER BY create_time ASC")
    List<LeaveApplication> selectPendingLeaveApplications(@Param("threeMinutesAgo") LocalDateTime threeMinutesAgo);
} 